import axios from 'axios'

const API_BASE = 'http://localhost:5000/api'

export const generateEduVideo = async (keyword) => {
  try {
    const response = await axios.post(`${API_BASE}/generate`, {
      keyword
    })
    return response.data
  } catch (error) {
    throw new Error(error.response?.data?.error || '请求失败')
  }
}